home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 8 / QRZ Ham Radio Callsign Database - Volume 8.iso / pc / files / misc / sparam48.hp < prev    next >
Text File  |  1996-06-25  |  4KB  |  160 lines

  1.                              S-PAR
  2.  
  3.                   Function for S Parameters design
  4.                           Version 2.1
  5.  
  6.         These are some function that I use in my calcolus in RF design with
  7. the HP48SX and since I think that even more ham are interested in microwave
  8. band I've posted it.
  9.  
  10.         Follow the description of the function present in the S directory,
  11. some routine that can help you in S parameter design at high frequencies.
  12.  
  13.  
  14. {MAG}- Maximum Available Gain:
  15.      IN: (1:)S11 (2:)S12 (3:)S21 (4:)S22
  16.      OUT: (1:)MAG
  17.      S parameters must be inserted in polar form referred to 50 ohm      
  18.      Gain is given in dB.
  19.  
  20. {MSG}- Maximum Stable Gain:
  21.      IN: (1:)S12 (2:)S21   <<<<<< ATTENTION: this is the only function      
  22.                             that use only  S12 and S21 ! >>>>>>>>      
  23.      OUT: (1:)MAG
  24.      S parameters must be inserted in polar form referred to 50 ohm      
  25.      Gain is given in dB.
  26.  
  27. {K}- Stability factor:
  28.      IN: (1:)S11 (2:)S12 (3:)S21 (4:)S22
  29.      OUT: (1:)K
  30.      K value is in the range from 0 to 1
  31.  
  32. {RHOIN}-Reflection coefficient at the input port when the output is matched: 
  33.      IN: (1:)S11 (2:)S12 (3:)S21 (4:)S22
  34.      OUT: (1:)RHOIN
  35.      It gives the reflection coefficient that you see at input port when the 
  36.      output port is matched, by the use of {->Z} function you can obtain the 
  37.      input impedance to match whit the source.
  38.  
  39. {RHOUT}-Reflection coefficient at the output port when the input is matched: 
  40.      IN: (1:)S11 (2:)S12 (3:)S21 (4:)S22
  41.      OUT: (1:)RHOUT
  42.      It gives the reflection coefficient that you see at output port when
  43.      the input port is matched, by the use of {->Z} function you can obtain
  44.      the output impedance to match whit the load.
  45.  
  46. {->Z}-From reflection coefficient to impedance (Z) (referred to {Z0})      
  47.      IN: (1:)S11 or (1:)S22 or (1:)RHOIN or (1:)RHOUT
  48.      OUT: (1:)Z11 or (1:)Z22
  49.      It transform the polar value of S11 or S22 in the correspondent value
  50.      of impedance referred to Z0.
  51.  
  52. {Z->}-From impedance (Z) to reflection coefficient (referred to {Z0})      
  53.      IN: (1:)Z11 or (1:)Z22 
  54.      OUT: (1:)S11 or (1:)S22 or (1:)RHOIN or (1:)RHOUT
  55.  
  56. {Z0}-Reference impedance
  57.      Value used by {SZ} but useful to know during calculation; usually 50
  58.      ohm; can be used every value
  59.  
  60. Place the following dir under path HOME/......./RF/S  in provision of new
  61. program for Radio Frequencies design.
  62.  
  63.  
  64. --------cut here------------------------------------------------
  65. %%HP: T(3)A(D)F(.);
  66. DIR
  67.   MSG
  68.     \<< SWAP / ABS
  69. LOG 10 *
  70.     \>>
  71.   MAG
  72.     \<< 4 DUPN K EVAL
  73. 5 ROLLD \-> I R D O
  74.       \<< 1 I ABS SQ
  75. + O ABS SQ - O I *
  76. D R * - ABS -
  77.         IF 0 >
  78.         THEN DUP SQ
  79. 1 - \v/ NEG +
  80.         ELSE DUP SQ
  81. 1 - \v/ +
  82.         END LOG 10
  83. * R D MSG EVAL +
  84.       \>>
  85.     \>>
  86.   K
  87.     \<< 4 DUPN 4 ROLL
  88. * 3 ROLLD * - ABS
  89. SQ 1 + 5 ROLLD ABS
  90. SQ NEG 4 ROLLD ABS
  91. SWAP ABS * 2 * SWAP
  92. ABS SQ NEG SWAP 4
  93. ROLLD + + SWAP /
  94.     \>>
  95.   \GrIN
  96.     \<< \-> S11 S12 S21
  97. S22
  98.       \<< 1 S11 ABS
  99. SQ + S22 ABS SQ -
  100. S11 S22 * S12 S21 *
  101. - ABS SQ - S11 S22
  102. CONJ S11 S22 * S12
  103. S21 * - * - DUP ARG
  104. 3 ROLLD ABS DUP2 SQ
  105. 4 * NEG SWAP SQ + \v/
  106. 3 PICK
  107.         IF 0 >
  108.         THEN NEG
  109.         END 3 ROLL
  110. + SWAP 2 * / SWAP
  111. DUP SIN i * SWAP
  112. COS + *
  113.       \>>
  114.     \>>
  115.   \GrOUT
  116.     \<< \-> S11 S12 S21
  117. S22
  118.       \<< 1 S22 ABS
  119. SQ + S11 ABS SQ -
  120. S11 S22 * S12 S21 *
  121. - ABS SQ - S22 S11
  122. CONJ S11 S22 * S12
  123. S21 * - * - DUP ARG
  124. 3 ROLLD ABS DUP2 SQ
  125. 4 * NEG SWAP SQ + \v/
  126. 3 PICK
  127.         IF 0 >
  128.         THEN NEG
  129.         END 3 ROLL
  130. + SWAP 2 * / SWAP
  131. DUP SIN i * SWAP
  132. COS + *
  133.       \>>
  134.     \>>
  135.   \->Z
  136.     \<< DUP 1 + SWAP
  137. 1 - NEG / Z0 *
  138.     \>>
  139.   Z\->
  140.     \<< DUP Z0 - SWAP
  141. Z0 + /
  142.     \>>
  143.   Z0 50
  144. END
  145. ----------------------------------------------------------------
  146. Send suggestions, comments, complaints to:
  147.  
  148.  
  149. ------------------------------------------------------------------------------
  150. Lapo Pieri               |       INTERNET:  lapo@iroe.iroe.fi.cnr.it        
  151.                          |       Phone   +39 55 4378512  (PABX-> 276)
  152. Istituto per la          |
  153. Ricerca sulle Onde       |       Home address: via A. dei Corbizi 9
  154. Elettromagnetiche (IROE) |                     50127  FIRENZE
  155.      (Firenze)           |                            ITALY
  156.                          |
  157. of the National          |       On air  IK5NAX
  158. Council of Research (CNR)|
  159. ------------------------------------------------------------------------------
  160.